package com.codeduck.injection.config;


import com.codeduck.injection.entity.Task;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

/**
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @createDate: 2021-12-24
 */
@Configuration
// ComponentScans可以配置多个@ComponentScan
@ComponentScan(
        basePackages = {"com.codeduck.injection.entity", "com.codeduck.injection.controller", "com.codeduck.injection.mapper"},
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {Controller.class, Repository.class}),
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {Task.class})}
)
public class ComponentScanFilterConfig {

    /**
     * 测试方法 {@link com.codeduck.injection.ComponentScanFilterConfigTest}
     *
     * 上方注解的逻辑： 扫描三个包路径，排除将使用注解@Controller，@Repository的类注入到IOC，以及 排除指定类型Task.class注入IOC
     * 其他排除类型请查看 {@link FilterType}
     */


}
